#! /bin/sh

# Make sure errors report (since we try to weed out potential spurious ones)
set -e

# /usr/lib/terminfo used to be the standard place for terminfo entries.
# Now, it's /usr/share/terminfo.  So if /usr/lib/terminfo _isn't_ a symbolic
# link, move the whole thing to /usr/share. 
if [ -e /usr/lib/terminfo -a ! -L /usr/lib/terminfo ]; then
  cp -dR /usr/lib/terminfo /usr/share;
  rm -rf /usr/lib/terminfo;
fi

# And the final piece of kludgery...if /usr/lib/{tabset,terminfo} _are_
# symbolic links, get rid of them for now.  This is necessary because we
# may end up in a state where the user replaces an older package and,
# because debian can't tell that /usr/lib/foo and /usr/share/foo are the
# same, it deletes the old package's /usr/lib files right after installing
# the new /usr/share ones.  This leaves the user in a state where he has
# no terminfo files at all.  :(
if [ -L /usr/lib/terminfo ]; then
  rm -f /usr/lib/terminfo
fi

#DEBHELPER#
